package com.visionet.waveletData.web.repository.plan;

import java.util.List;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import com.visionet.waveletData.web.entity.plan.PlanFile;
import com.visionet.waveletData.web.entity.plan.PlayPlan;

public interface PlanFileDao extends PagingAndSortingRepository<PlanFile, Long>, JpaSpecificationExecutor<PlanFile>{

	@Query("select u from PlanFile u where u.id=?1 ")
    PlayPlan findPlanFileById(Long id);

	@Query("select u from PlanFile u where u.is_deleted='0' and u.planId=?1 ")
	List<PlanFile> findPlanFileByPlanId(String planId);
	
	@Query("select u from PlanFile u where u.is_deleted='0' and u.fileName=?1 and u.planId=?2")
	List<PlanFile> findPlanFileByFileNameAndPlanId(String fileName,String planId);

	//根据分组ID查找播放计划
	int findAllByGroupId(String groupId);


}
